package ace.module.account.core.impl.service.biz.impl;

import ace.module.account.core.impl.service.biz.PasswordBiz;
import lombok.AllArgsConstructor;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;

/**
 * @author caspar
 * @date 2023/3/20 9:23
 */
@AllArgsConstructor
@Component
public class PasswordBizImpl implements PasswordBiz {
  private final PasswordEncoder passwordEncoder;

  @Override
  public String getPhoneDefaultPassword(String phone) {
    String partPhone = phone.substring(11 - 6);
    return passwordEncoder.encode(partPhone);
  }
}
